Please study list algorithm: search in openbook chapter 14.
  • Linear search
  • Binary search
You should be able to program each of them by yourself for different problems.
Please study about the time complexity of the two algorithms.

Here is a piece of code of testing and visualizing the comparison of time complexity of linear search and binary search, please study the code.